package com.alibaba.springboot.health.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpSession;

/**
 * @author King_long
 * @program: health
 * @Date 2019-12-24 19:36
 */
@Controller
public class RootController {

    private static final Logger LOGGER= LogManager.getLogger(RootController.class);

    /**
     * all
     * @return
     */
    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String index(HttpSession session) {
        session.removeAttribute("user");
        return "start";
    }

    /**
     * zdj
     * @param list
     * @return
     */
    @RequestMapping("/{list}")
    public String list(@PathVariable("list")String list){
        return list;
    }

    /**
     * xl
     * @return
     */
    @RequestMapping(value = "/project", method = RequestMethod.GET)
    public String project() {
        return "project";
    }

    /**
     * xl
     * @return
     */
    @RequestMapping(value = "/projects", method = RequestMethod.GET)
    public String projects() {
        return "projects";
    }

    /**
     * xl
     * @return
     */

    @RequestMapping(value = "/default/log", method = RequestMethod.GET)
    public String login() {
        return "login";
    }

    /**
     * xl
     * @return
     */
    @RequestMapping(value = "/default/reg", method = RequestMethod.GET)
    public String reg() {
        return "reg";
    }

}
